#ifndef RAT_H
#define RAT_H

#include <QtGui>
#include<QTime>
#include<QDateTime>
#include<QTextStream>
#include<QThread>
#include <windows.h>
#include "windowseventlogger.h"
#include "configfile.h"

    class Rat : public QWidget
    {
        Q_OBJECT

    public:
        Rat(QWidget *parent = 0);
       
    protected:
        void mouseMoveEvent(QMouseEvent *event);
        void mousePressEvent(QMouseEvent *event);
        void closeEvent ( QCloseEvent * event );
        void contextMenuEvent(QContextMenuEvent *event);
                    
    public slots:
        void handleKeyPress(QKeyEvent event);
        void reset();
        void startRecording();
        void missed();
        
    private:
        QSettings* settings;
        QLabel* label;                
        QPoint dragPosition;
        WindowsEventLogger logger;
        ConfigFile* config;
        QString color;
        QTime startTime;               
        QString result;               
        int height;
        int width;
        bool recording;        
                
        int calculateInterval();
        void writeToFile();        
        void setLabelColor(QString color);
        QString getBrowserUrl();
          
        
        
       
              
    };

#endif
